import Vue from 'vue'
import Vuex from 'vuex'

// 导入子功能
import getters from './getters'
import mutations from './mutations'
import actions from './actions'

import launch from '../bootstrap/launch'

Vue.use(Vuex)

export default async () => {
  const store = new Vuex.Store({
    state: {
      user: null
    },
    mutations,
    actions,
    getters,
    modules: {
    }
  })

  await launch(store)

  return store
}
